<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>数组解构赋值</title>
  <script type="text/javascript">

    let arr=[1,2,3]
    console.log("arr= ",arr) //Array(3)

    //数组解构[取出元素]
    //1.传统
    let x=arr[0],y=arr[1],z=arr[2]
    console.log(x,y,z)
    //2.ES6风格
    //方式一
    let [a,b,c]=arr

    console.log("方式一: ",a,b,c)
    //方式二
    let [num1,num2,num3]=[100,200,300]
    console.log("方式二: ",num1,num2,num3)
  </script>
</head>
<body>

</body>
</html>